<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>


  <script type="text/javascript">

    var arr = ['one', 'two', 'three','11111','11133'];
    var obj = {};

    // 数组里面字符串的长度统计并分组
    // 答案 { '3': ['one', 'two'], '5': ['three'] }

    var key = []  // 放数组元素的长度

    for (var i = 0; i < arr.length; i++) {
      key.push(arr[i].length)
    }
    for (let z = 0; z < key.length;) {
      var count = 0;
      var temp = []
      for (var j = z; j < key.length; j++) {
        if (key[z] == key[j]) {
          count++;
          temp.push(arr[j])
        }
      }
      obj[key[z]] = temp
      z += count
    }
    console.log(obj)



   
  </script>
</body>

</html>